import ollama

question = input("请输入问题：") or "20字介绍北京"

response = ollama.chat(
    model='llama3.2',      # model='qwen2.5:3b',
    messages=[{'role': 'user', 'content': question }],
    stream=True,
    options={
        'temperature': 0.1,
    }
)

print("问:",question,"?\n答:")

for chunk in response:
    print(chunk['message']['content'], end='', flush=True)